package com.million.eduservice.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.million.eduservice.entity.EduCourse;
import com.million.eduservice.entity.frontvo.course.CourseWebVo;
import com.million.eduservice.entity.vo.course.CourseInfoList;
import com.million.eduservice.entity.vo.course.CoursePublishVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 课程 Mapper 接口
 * </p>
 *
 * @author 十麓
 * @since 2022-03-24
 */
@Mapper
public interface EduCourseMapper extends BaseMapper<EduCourse> {

    //通过课程id得到课程信息
    public CoursePublishVo getPublishCourseInfo(String courseId);

    //直接查询课程信息，用vo封装
    //@Param(Constants.WRAPPER) 加上这个注解
    public Page<CourseInfoList> getCourseInfoList (Page<CourseInfoList> courseListPage,
                                                   @Param(Constants.WRAPPER) QueryWrapper<CourseInfoList> queryWrapper);
    //根据d 获取课程信息，编写sql语句
    CourseWebVo getBaseCourseInfo (String courseId);
}
